Skip to main content
ICT
Lesson A6 - Libraries and APIs
 
Main Previous Next
Title Page >  
Summary >  
Lesson A1 >  
Lesson A2 >  
Lesson A3 >  
Lesson A4 >  
Lesson A5 >  
Lesson A6 >  
Lesson A7 >  
Lesson A8 >  
Lesson A9 >  
Lesson A10 >  
Lesson A11 >  
Lesson A12 >  
Lesson A13 >  
Lesson A14 >  
Lesson A15 >  
Lesson A16 >  
Lesson A17 >  
Lesson A18 >  
Lesson A19 >  
Lesson A20 >  
Lesson A21 >  
Lesson A22 >  
Lesson AB23 >  
Lesson AB24 >  
Lesson AB25 >  
Lesson AB26 >  
Lesson AB27 >  
Lesson AB28 >  
Lesson AB29 >  
Lesson AB30 >  
Lesson AB31 >  
Lesson AB32 >  
Lesson AB33 >  
Vocabulary >  
 

A. Understanding APIs page 3 of 12

  1. API stands for Application Programming Interface and is one of the most useful tools you will have while working with Java. APIs show exactly how to use pre-made classes. The DrawingTool Class Specifications handout in Lesson A1 is an example of a simplified API. It lists the classes and constructors so that we know which methods are available. APIs do not tell us how the programmer dealt with a problem or what kind of formulas they used internally, but just tells us what methods we can access, how to interact with those methods, and what those methods will return back to us.

  2. You can always access the Java APIs at java.sun.com. Click on API Specifications on the main page and then choose the version of Java you wish to retrieve the API for. You can also download the APIs to your computer for offline access. Many Java programming environments can be set up to access the APIs from within your code.

  3. The Java APIs are organized both by package and by class. Packages are groups of related classes that are “packaged” together. When you use the code import gpdraw.*; you are adding the entire gpdraw package to your code. If you only need one or two classes from a package, you can add the classes individually with the code import gpdraw.DrawingTool;.

 

Main Previous Next
Contact
 © ICT 2006, All Rights Reserved.